package com.lz.comm

import com.tencent.mmkv.MMKV

object SP {

    fun getInt(key: String, defValue: Int) = MMKV.defaultMMKV().getInt(key, defValue)

    fun setInt(key: String, defValue: Int) {
        MMKV.defaultMMKV().encode(key, defValue)
    }

    fun getLong(key: String, defValue: Long) = MMKV.defaultMMKV().getLong(key, defValue)

    fun setLong(key: String, defValue: Long) {
        MMKV.defaultMMKV().encode(key, defValue)
    }

    fun getBoolean(key: String, defValue: Boolean) = MMKV.defaultMMKV().getBoolean(key, defValue)

    fun setBoolean(key: String, defValue: Boolean) {
        MMKV.defaultMMKV().encode(key, defValue)
    }

    fun getString(key: String, defValue: String) = MMKV.defaultMMKV().getString(key, defValue)

    fun setString(key: String, defValue: String) {
        MMKV.defaultMMKV().encode(key, defValue)
    }

    fun remove(key: String) {
        MMKV.defaultMMKV().remove(key)
    }
}